﻿using System;

namespace Meqs.Entity
{
    /// <summary>
    /// 系统表
    /// </summary>
    [Serializable]
    public class SystemInfo
    {
        private int _rID;
        private int _systemNo;
        private string _systemName;
        private string _remark;

        public SystemInfo()
        {
        }

        public SystemInfo(int rID, int systemNo, string systemName, string remark)
        {
            _rID = rID;
            _systemNo = systemNo;
            _systemName = systemName;
            _remark = remark;
        }

        public int RID
        {
            get { return _rID; }
            set { _rID = value; }
        }

        /// <summary>
        /// 权限编号
        /// </summary>
        public int SystemNo
        {
            get { return _systemNo; }
            set { _systemNo = value; }
        }

        /// <summary>
        /// 子系统名称
        /// </summary>
        public string SystemName
        {
            get { return _systemName; }
            set { _systemName = value; }
        }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark
        {
            get { return _remark; }
            set { _remark = value; }
        }

        public bool Equals(SystemInfo other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return other._rID == _rID;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof (SystemInfo)) return false;
            return Equals((SystemInfo) obj);
        }

        public override int GetHashCode()
        {
            return _rID;
        }
    }
}
